package sealte.wdgf.system.config;

import java.io.File;

import org.jdom2.Element;

import sealte.wdgf.model.system.HTMLConfigObject;
import sealte.wdgf.utils.XMLBaseObject;

public class HTMLConfigReader {
	
	private HTMLConfigObject hco;
	private Element html;
	
	public HTMLConfigReader(){
		getRootElement();
	}
	
	private void getRootElement(){
		XMLBaseObject xml = new XMLBaseObject(
				new File(DatabaseInfoReader.class.getResource("").getPath()
						+"../../../../../config/config-html.xml"));
		html = xml.getRoot();
	}
	
	public HTMLConfigObject getConfigObject(){
		hco = new HTMLConfigObject();
		Element head = html.getChild("head");
		Element title = head.getChild("title");
		hco.setTitle(title.getText());
		return hco;
	}
}
